﻿using System;
using System.Text;
using System.Data;
using System.Data.SqlClient;
using System.Data.Common;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Configuration;
using System.Xml;
using System.Xml.Serialization;
using SubSonic;
using SubSonic.Utilities;
namespace LMSData
{

    public partial class UserProfileController
    {
        public UserProfile FetchByUserID(int UserID)
        {
            UserProfileCollection upc = new UserProfileCollection();
            Query qry = new Query(UserProfile.Schema).WHERE(UserProfile.Columns.UserID, UserID);
            upc.LoadAndCloseReader(qry.ExecuteReader());

            if (upc.Count > 0)
                return upc[0];
            return new UserProfile();
        }
    }
}
